﻿using System;
using System.Collections.Generic;
using System.Text;

namespace CVSS.Client.BDM.UI
{
    partial class DangerEnterpriseManageFormMDT
    {
        /// <summary>
        /// 窗体界面
        /// </summary>
        private DangerEnterpriseManageForm form = null;
        /// <summary>
        /// 构造函数
        /// </summary>
        public DangerEnterpriseManageFormMDT()
        {
            try
            {
                form = new DangerEnterpriseManageForm();
                form.Load += new EventHandler(form_Load);
                form.btn_Add.Click += new EventHandler(btn_Add_Click);
                form.btn_Delete.Click += new EventHandler(btn_Delete_Click);
                form.btn_Modify.Click += new EventHandler(btn_Modify_Click);
                form.btn_Query.Click += new EventHandler(btn_Query_Click);
                form.btn_Save.Click += new EventHandler(btn_Save_Click);
                form.dvp_DataView.dg_DataView.SelectionChanged += new EventHandler(dg_DataView_SelectionChanged);
                form.dvp_DataView.OnDataChangedHandlerEvent += new SysCommon.UI.DataGridViewForPageCtrl.OnDataChangedHandler(dvp_DataView_OnDataChangedHandlerEvent);
            }
            catch (Exception ex)
            {
                SysCommon.Global.mainLog.Error(
                    "调用DangerCargoManageFormMDT.DangerCargoManageFormMDT()出错", ex);
            }
        }

        void btn_Save_Click(object sender, EventArgs e)
        {
            Save();
        }

        void btn_Query_Click(object sender, EventArgs e)
        {
            BeginQuery();
        }

        void btn_Modify_Click(object sender, EventArgs e)
        {
            Modify();
        }

        void btn_Delete_Click(object sender, EventArgs e)
        {
            Delete();
        }

        void btn_Add_Click(object sender, EventArgs e)
        {
            Add();
        }
        /// <summary>
        /// 显示窗体
        /// </summary>
        public bool ShowForm()
        {
            try
            {
                form.ShowDialog();
                return true;
            }
            catch (Exception ex)
            {
                SysCommon.Global.mainLog.Error(
                    "调用DangerCargoManageFormMDT.ShowForm()出错", ex);
            }
            return false;
        }
        /// <summary>
        /// 加载窗体
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void form_Load(object sender, EventArgs e)
        {
            try
            {
                InitDataGridView();
                //查询基本信息
                QueryBaseInfo();
                BeginQuery();
                
            }
            catch (Exception ex)
            {
                SysCommon.Global.mainLog.Error(
                    "调用DangerCargoManageFormMDT.form_Load(object sender, EventArgs e)出错", ex);
            }
        }

    }
}
